 class Haha{
    public int value;
 }
public class Test {
public static void swap(Haha x,Haha y){
    int tmp=x.value;
    x.value=y.value;
    y.value=tmp;
}

    public static void main(String[] args) {
        Haha haha1=new Haha();
        haha1.value=10;
        Haha haha2=new Haha();
        haha2.value=20;
        System.out.println("交换前"+haha1.value+" "+haha2.value);
        swap(haha1,haha2);
        System.out.println("交换后"+haha1.value+" "+haha2.value);
    }
}
